import qrcode

secret='PJ4TMSLKJ54UWTDXJNMVS6JUJRJUC4TW'
uri = 'otpauth://totp/{name}?secret={secret}&issuer={issuer}'.format(
    name='name',
    secret=secret,
    issuer='Keystone')

img = qrcode.make(uri)
img.save('totp.png')
